package parabullgame;

import java.awt.Color;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Tyler
 */
public class GraphLine extends Entity
{
    private double length = 0;
    private Color color;
    public GraphLine(double x,double y,double length,double angle, Color myColor){
        this.xpos = x;
        this.ypos = y;
        this.length = length;
        this.angle = -angle;
        this.color = myColor;
    }
    public void draw(){
        double x1 = this.xpos + Math.sin(Math.toRadians(this.angle))*(this.length/2);
        double y1 = this.xpos + Math.cos(Math.toRadians(this.angle))*(this.length/2);
        double x2 = this.xpos - Math.sin(Math.toRadians(this.angle))*(this.length/2);
        double y2 = this.xpos - Math.cos(Math.toRadians(this.angle))*(this.length/2);
        

        DrawUtil.line((int)x1,(int)y1,(int)x2,(int)y2, this.color);
    }
    
    
}
